<template>
  <vue-office-docx
    :src="props.url"
    @rendered="renderedHandler"
    @error="errorHandler"
  />
</template>
<script setup>
//引入VueOfficeDocx组件
import VueOfficeDocx from "@vue-office/docx";
//引入相关样式
import "@vue-office/docx/lib/index.css";
const props = defineProps({
  url: {
    type: String,
    default: "",
  },
});
// docx作为参数通过父组件传参
const renderedHandler = () => {
  console.log("渲染完成");
};
const errorHandler = () => {
  console.log("渲染失败");
};
</script>
